import request from '@/utils/request'

// 查询设备事件表列表
export function listDeviceEvent(query) {
  return request({
    url: '/alarm/deviceEvent/list',
    method: 'get',
    params: query
  })
}

// 查询设备事件表详细
export function getDeviceEvent(id) {
  return request({
    url: '/alarm/deviceEvent/' + id,
    method: 'get'
  })
}

// 新增设备事件表
export function addDeviceEvent(data) {
  return request({
    url: '/alarm/deviceEvent',
    method: 'post',
    data: data
  })
}

// 修改设备事件表
export function updateDeviceEvent(data) {
  return request({
    url: '/alarm/deviceEvent',
    method: 'put',
    data: data
  })
}

// 删除设备事件表
export function delDeviceEvent(id) {
  return request({
    url: '/alarm/deviceEvent/' + id,
    method: 'delete'
  })
}

// 查询设备事件表详细
export function getEventOptions(siteId) {
  return request({
    url: '/alarm/deviceEvent/getEventOptions?siteId=' + siteId,
    method: 'get'
  })
}

// 查询设备事件表列表
export function optionEvents(query) {
  return request({
    url: '/alarm/deviceEvent/optionEvents/'+query.definedId+'/'+query.type,
    method: 'get'
  })
}